﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using System.Configuration;

public partial class Reports_DataReporte2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        String fecha = "";
        string date = DropDownList2.SelectedItem.Text;
        DateTime dt = Convert.ToDateTime(date);
        fecha=String.Format("{0:yyyy-MM-dd}", dt);
        Response.Redirect("Reporte2.aspx?ruta=" + DropDownList1.SelectedItem.Text + "&Fecha=" + fecha);
        //http://localhost:2067/EnGasAdoAPP/Reports/Reporte2.aspx?ruta=" + DropDownList1.SelectedItem.Text + "&Fecha=" + fecha
    }
    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
    {

    }
   // string consulta = "SELECT DISTINCT dbo.Precio.fecha " +
   //                 "FROM            dbo.tbl_ruta INNER JOIN " +
   //                 "                         dbo.tbl_gasolinera_x_ruta ON dbo.tbl_ruta.id_ruta = dbo.tbl_gasolinera_x_ruta.id_ruta INNER JOIN " +
   //                 "                         dbo.Gasolinera ON dbo.tbl_gasolinera_x_ruta.id_gasolinera = dbo.Gasolinera.ID_Gasolinera INNER JOIN " +
   //                 "                         dbo.Precio ON dbo.Gasolinera.ID_Gasolinera = dbo.Precio.ID_Gasolinera " +
   //                 "WHERE        (dbo.tbl_ruta.nombre_ruta = '" + DropDownList1.SelectedItem.Text + "')";
    protected void DropDownList1_TextChanged(object sender, EventArgs e)
    {

    }
    protected void DropDownList1_Load(object sender, EventArgs e)
    {
       
    }
    protected void DropDownList1_PreRender(object sender, EventArgs e)
    {
       
    }
    protected void DropDownList1_Init(object sender, EventArgs e)
    {
       
    }
    protected void DropDownList1_Disposed(object sender, EventArgs e)
    {
       
    }
    protected void DropDownList1_DataBound(object sender, EventArgs e)
    {
      
    }
    protected void DropDownList1_DataBinding(object sender, EventArgs e)
    {
        
    }
    protected void DropDownList1_Unload(object sender, EventArgs e)
    {
        
    }
    protected void DropDownList3_SelectedIndexChanged(object sender, EventArgs e)
    {
        int a = 2;
    }
    protected void Button2_Click(object sender, EventArgs e)
    {

        Response.Redirect("DataReporte2_2.aspx?ruta=" + DropDownList1.SelectedItem.Text);
    }
}